"""matrix URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include
from serverworker import views,chart_views
from django.conf import settings
from django.conf.urls.static import static



from serverworker.site_views import site_obj


urlpatterns = [
    path('admin/feedback_stats', views.feedback_stats),
    path('admin/', admin.site.urls),
    #path('admin/aa/', tests.querry),
    # url(r'^media/(?P<path>.*)$',serve,{'document_root':settings.MEDIA_ROOT}), # 生产环境下加入该行，用于在（debug=False）生产环境下显示图片，如果不加该行，在生产环境下无法显示图片
    path('fe/', views.feedback_stats),
    path('hello',views.helloword),
    path('table',views.demo_table),
    path('qr',views.qr),
    path('qr_download',views.qr_download),
    path('custom/<int:id>/', views.my_custom_view, name='my_custom_view'),

    #wechat
    path('wechat_login/', views.wechat_login),
    path('demo',views.demo),
    path('select_device_info_one/',views.select_device_info_one),
    path('select_device_attribute_one/',views.select_device_attribute_one),
    path('select_device_maintenance_log_one/',views.select_device_maintenance_log_one),
    path('get_organ_index/',views.get_organ_index),
    #path('send_organ_index/',views.send_organ_index),
    #path('upload/', views.upload_image, name='upload_image'),
    path('add_device_info_one/',views.add_device_info_one),
    #path('add_device_attribute_one/',views.add_device_attribute_one),

#IOT
    #数据图形页面
    path('chart_electricity/', chart_views.ChartDataView_electricity ),
    path('chart_temperature/', chart_views.ChartDataView_temperature ),
    #设备接口
    path('temperature_meter_list/', chart_views.temperature_meter_list ),
    path('electricity_meter_list/', chart_views.electricity_meter_list ),
    #状态
    path('iot_status/', chart_views.iot_status ),

    path('test/', views.echarts ),




]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) #添加该行，为了上传和显示图片


if settings.DEBUG:
     import debug_toolbar
     urlpatterns = [
         path('__debug__/', include(debug_toolbar.urls)),
        # For django versions before 2.0:
         # url(r'^__debug__/', include(debug_toolbar.urls)),
    ] + urlpatterns